package org.geektimes.configuration.microprofile.config.converters;

import org.eclipse.microprofile.config.spi.Converter;

public abstract class AbstractConverter<T> implements Converter<T> {

	private static final long serialVersionUID = -3257419291581527332L;

	@Override
	public T convert(String value) throws IllegalArgumentException, NullPointerException {
		
		if( value == null ) {
			throw new NullPointerException("The value must not be null!");
		}
		
		return doConvert(value);
	}

	protected abstract T doConvert(String value);

}
